package io.github.zhengyue.basics

/**
 * 函数表达式
 */
fun add(x:Int, y:Int):Int = x + y

fun main(args: Array<String>) {
    var result = add(1, 2)
    println(result)

    var funI = {x:Int, y:Int -> x+y}
    var result2 = funI(2, 3)
    println(result2)

    var funJ:(Int, Int) -> Int = {x, y -> x + y}
    val result3 = funJ(3, 4)
    println(result3)
}